package de.baumann.browser.present.duobao

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.duobao.CYJL
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.duobao.ICanYuDetailView
import de.baumann.browser.model.selectJoinInfo

class CanYuDetailPresenter : BasePresenter<ICanYuDetailView>() {
    fun data() {
        selectJoinInfo(view!!.id)
                .subscribe(object : OdinObserver<CYJL>(view) {
                    override fun onSuccess(data: CYJL?) {
                        if (data == null) {
                            return
                        }
                        view?.settx(data.avatar)
                        view.setnc(data.userName)
                        view.setaddress(data.address)
                        view.settime(data.createTime)
                        view.setqh(data.phaseNum)
                        view.setfs(data.participationNum)
                        data.numberList?.let {
                            view.sethm(it)
                        }
                    }
                })
    }
}